package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.RiskInspectionMapper;
import com.ruoyi.yanjing.domain.RiskInspection;
import com.ruoyi.yanjing.service.IRiskInspectionService;

/**
 * 隐患排查记录Service业务层处理
 * 
 * @author whz
 * @date 2024-12-06
 */
@Service
public class RiskInspectionServiceImpl implements IRiskInspectionService 
{
    @Autowired
    private RiskInspectionMapper riskInspectionMapper;

    /**
     * 查询隐患排查记录
     * 
     * @param id 隐患排查记录主键
     * @return 隐患排查记录
     */
    @Override
    public RiskInspection selectRiskInspectionById(Long id)
    {
        return riskInspectionMapper.selectRiskInspectionById(id);
    }

    /**
     * 查询隐患排查记录列表
     * 
     * @param riskInspection 隐患排查记录
     * @return 隐患排查记录
     */
    @Override
    public List<RiskInspection> selectRiskInspectionList(RiskInspection riskInspection)
    {
        return riskInspectionMapper.selectRiskInspectionList(riskInspection);
    }

    /**
     * 新增隐患排查记录
     * 
     * @param riskInspection 隐患排查记录
     * @return 结果
     */
    @Override
    public int insertRiskInspection(RiskInspection riskInspection)
    {
        riskInspection.setCreateTime(DateUtils.getNowDate());
        return riskInspectionMapper.insertRiskInspection(riskInspection);
    }

    /**
     * 修改隐患排查记录
     * 
     * @param riskInspection 隐患排查记录
     * @return 结果
     */
    @Override
    public int updateRiskInspection(RiskInspection riskInspection)
    {
        riskInspection.setUpdateTime(DateUtils.getNowDate());
        return riskInspectionMapper.updateRiskInspection(riskInspection);
    }

    /**
     * 批量删除隐患排查记录
     * 
     * @param ids 需要删除的隐患排查记录主键
     * @return 结果
     */
    @Override
    public int deleteRiskInspectionByIds(Long[] ids)
    {
        return riskInspectionMapper.deleteRiskInspectionByIds(ids);
    }

    /**
     * 删除隐患排查记录信息
     * 
     * @param id 隐患排查记录主键
     * @return 结果
     */
    @Override
    public int deleteRiskInspectionById(Long id)
    {
        return riskInspectionMapper.deleteRiskInspectionById(id);
    }
}
